<template>
  <div>
    <h4>环境因素</h4>
    <el-card class="box-card">
      <el-table
      :data="pgForm"
      stripe
      border
      :span-method="spanMethod"
      style="width: 100%;margin-top: 20px"
      :header-cell-style="{background:'#edf6fa'}"
      :cell-style="cellStyle"
    >
      <el-table-column prop="hj_assProject" label="" width="100px" align="center"></el-table-column>
      <el-table-column prop="hj_aspect" label="" width="110px" align="center"></el-table-column>
      <el-table-column label="评定内容" align="center">
        <template slot-scope="scope">
          <el-input v-model="scope.row.hj_assContent"></el-input>
        </template>
      </el-table-column>
    </el-table>
    </el-card>
  </div>
</template>

<script>

export default {
  name: "environment",
  title: "环境因素",
  created() {
    if(this.istrans){
      this.pgForm=this.fromdata
    }
  },
  props:{
    fromdata:{},
    istrans:false,
  },
  data() {
    return {
      pgForm: [
        {
          hj_assProject:'环境因素',
          hj_aspect:'助手',
          hj_assContent:''
        },{
          hj_assProject:'环境因素',
          hj_aspect:'家人态度',
          hj_assContent:''
        },{
          hj_assProject:'环境因素',
          hj_aspect:'居住环境',
          hj_assContent:''
        },{
          hj_assProject:'环境因素',
          hj_aspect:'经济状况',
          hj_assContent:''
        },
      ],
    };
  },
  methods: {
    spanMethod({rowIndex,columnIndex}){
      if(columnIndex === 0){
        if(rowIndex === 0){
          return [4,1]
        }else{
          return [0,0]
        }
      }
    },
    cellStyle({columnIndex}){
      if(columnIndex<=1){
        return 'background-color:#edf6fa'
      }else {
        return ''
      }
    }
  }
}
</script>

<style scoped>

</style>
